package service;

import java.util.Map;

import models.AfforestationType;
import models.dto.AfforestationTypeDto;

public class AfforestationTypeRegService {
    public static void registerInfo(Map<String, String> RegInfoArgs){
        AfforestationTypeDto info = new AfforestationTypeDto(RegInfoArgs);
//        //verify required
//        MVCUtils.verifyRequiredElements(appRegInfoArgs, AppInfoDto.requiredFieldKeys);
//        //check duplicate app name
//        checkAppExistence(oneAppInfo.getAniAppDao());
//        //check rely on app privacy(self, or private & public only)
//        checkRelyOnAppPrivacy(curUser, AniApp.findByAppId(
//                oneAppInfo.relyOnAppId
//        ));
        saveInfo(info);
    }

    private static void saveInfo(AfforestationTypeDto info){
        try{
            AfforestationType afforestationType = new AfforestationType(info);
            afforestationType.save();
        }catch(Exception e){
//            throw new AniAuthException("APP_REGISTER_FAILED");
        	e.printStackTrace();
        }
    }
}
